<template>
  <div>
      <div class="top">
          <a href="#" @click="goback"></a>
          <p>添加银行卡</p>
      </div>
      <div class="content">
          <li>
              <p>银行卡名称</p>
              <span>网商银行</span>
          </li>
          <li>
              <p>银行卡后四位</p>
              <input type="text" v-model="number" placeholder="请输入后四位数字">
          </li>
          
         <button @click="go">完成</button>
      </div>
  </div>
</template>

<script>
export default {
    data(){
        return{
          number:null,
        }
    },
    methods:{
        goback(){
            this.$router.go("-1")
        },
        go(){
           
           if(this.number){
               this.global.bank.push({
                   name:"工商银行",
                   number:this.number
               })
               this.$toast("添加成功")
               this.$router.go("-1")
           }else{
               this.$toast.fail("请输入银行后四位")
           }
            
        }
    }
    
}
</script>

<style lang="less" scoped>
.top{
    background-color: #ff8f87;
    display: flex;
    align-items: center;
    height: 40px;
    a{
        width: 20px;
        height: 20px;
        background: url("../../assets/img/left.png")no-repeat;
        background-size: 100%;
    }
    p{
        margin: 0;
        margin-left: 33%;
        color: #fff;
    }
}
.content{
    height: 700px;
    li{
        display: flex;
        justify-content: space-between;
         margin: 10px 10px; 
        p{
            margin: 0;
            font-size: 14px;
            font-weight: 600;
        }
        span{
            font-size: 12px;
            color: #7a7a7a;
        }
        input{
        border: none;
        display: block;
        background-color: #fff;
        width: 30%;
        height: 30px;
        font-size: 12px;
    }
    }
    
    button{
        width: 95%;
        height: 35px;
        display: block;
        margin: 30px auto;
        border: none;
        color: #fff;

    }
}
</style>